package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.Commodity;
import cn.wolfcode.trip.base.domain.News;
import cn.wolfcode.trip.base.domain.Travel;
import cn.wolfcode.trip.base.domain.User;
import cn.wolfcode.trip.base.query.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.io.File;
import java.util.List;

public interface UserMapper {
    int deleteByPrimaryKey(Long id);

    int insert(User record);

    User selectByPrimaryKey(Long id);

    List<User> selectAll();

    int updateByPrimaryKey(User record);

    User selectUserByEmailAndPassword(@Param("email") String email, @Param("password") String password);

    List<User> selectForList(QueryObject qo);

    List<Integer> selectAuthorByUserId(Long userId);

    void deleteFansRelation(@Param("userId") Long userId, @Param("authorId") Long authorId);

    void updateFans(User user);

    void insertFansRelation(@Param("userId") Long userId, @Param("authorId") Long authorId);

    void updateFollows(User user);

    Integer relations(@Param("userId") Long userId, @Param("authorId") Long authorId);

    List<Travel> getTravelCollections(Long userId);

    List<News> getNewsCollections(Long userId);

    Integer travelRelations(@Param("userId") Long userId, @Param("travelId") Long travelId);

    Integer newsRelations(@Param("userId") Long userId, @Param("newsId") Long newsId);

    List<Integer> selectTravelByUserId(Long userId);

    void deleteTravelRelation(@Param("userId") Long userId, @Param("travelId") Long travelId);

    void insertTravelRelation(@Param("userId") Long userId, @Param("travelId") Long travelId);

    List<Integer> selectNewsByUserId(Long userId);

    void deleteNewsRelation(@Param("userId") Long userId, @Param("newsId") Long newsId);

    void insertNewsRelation(@Param("userId") Long userId, @Param("newsId") Long newsId);
}